﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="jTemplateTest.aspx.cs" Inherits="JuSolution.Web.Template.jTemplateTest" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script type="text/javascript" src="../Content/Script/artTemplate.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="content">
    
    </div>

    </form>
    <script id="test" type="text/html">
       {if isAdmin}
    <h3>{title}</h3>
    <ul>
        {each list}
            <li>{$index + 1}: {$value}</li>
        {/each}
    </ul>
{/if}
</script>
    <script>
        var data = {
            title: '基本例子',
            isAdmin: true,
            list: ['文艺', '博客', '摄影', '电影', '民谣', '旅行', '吉他']
        };
        var html = template.render('test', data);
        document.getElementById('content').innerHTML = html;
</script>
</body>
</html>
